/*
 * SerializableB.cpp
 *
 *  Created on: 13.11.2011
 *      Author: Pavel Sinay
 */

#include <strstream>
#include <iostream>

#include "SerializableB.h"

std::vector<SerializableB> SerializableB::m_instances;
const std::string SerializableB::m_name = "B";

SerializableB::SerializableB() {
}

SerializableB::~SerializableB() {
}

std::string SerializableB::serialize() const {
	std::strstream stream;
	stream << m_name << "\n" << m_b;
	return stream.str();
}

void SerializableB::deserialize(const std::string & data) {
	std::strstream stream;
	std::string name;

	stream << data;
	stream >> name;
	if (name == m_name) {
		SerializableB ser_b;
		stream >> ser_b.m_b;
		m_instances.push_back(ser_b);
	}
}

double SerializableB::getB() const {
	return m_b;
}

void SerializableB::setB(double m_b) {
	this->m_b = m_b;
}

